import ImageOrIcon from '@/components/ImageOrIcon';
import pUnselected from '@/images/cart/unselected.svg';
import { View } from '@tarojs/components';
import React from 'react';
import styles from './index.module.scss';

const OrgHeader = ({ orgName, onClick, onSelect, isAllSelected }) => {
  return (
    <View className={styles.OrgHeader}>
      <View className="line" onClick={onClick}>
        <View
          className="select"
          onClick={(e) => {
            e.stopPropagation();

            onSelect();
          }}
        >
          <ImageOrIcon
            {...{
              className: 'icon',

              name: isAllSelected && 'icon_chose',
              size: 30,

              src: pUnselected,
            }}
          />
        </View>

        <View className="title omit">{orgName}</View>
      </View>
    </View>
  );
};

export default OrgHeader;
